- page_title           "#{@issue.title} (##{@issue.iid})", "问题"
- page_description     @issue.description
- page_card_attributes @issue.card_attributes
- header_title         project_title(@project, "问题", namespace_project_issues_path(@project.namespace, @project))

.clearfix.detail-page-header
  .issuable-header
    .issuable-status-box.status-box.status-box-closed{ class: issue_button_visibility(@issue, false) }
      = icon('check', class: "hidden-sm hidden-md hidden-lg")
      %span.hidden-xs
        已关闭
    .issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) }
      = icon('circle-o', class: "hidden-sm hidden-md hidden-lg")
      %span.hidden-xs 未关闭

    %a.btn.btn-default.pull-right.visible-xs-block.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" }
      = icon('angle-double-left')

    .issuable-meta
      = confidential_icon(@issue)
      = issuable_meta(@issue, @project, "问题")

  - if can?(current_user, :create_issue, @project) || can?(current_user, :update_issue, @issue)
    .issuable-actions
      .clearfix.issue-btn-group.dropdown
        %button.btn.btn-default.pull-left.hidden-md.hidden-lg{ data: { toggle: "dropdown" } }
          %span.caret
          选项
        .dropdown-menu.dropdown-menu-align-right.hidden-lg
          %ul
            - if can?(current_user, :create_issue, @project)
              %li
                = link_to '新问题', new_namespace_project_issue_path(@project.namespace, @project), title: '新问题', id: 'new_issue_link'
            - if can?(current_user, :update_issue, @issue)
              %li
                = link_to '重新打开问题', issue_path(@issue, issue: { state_event: :reopen }, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn-reopen #{issue_button_visibility(@issue, false)}", title: '重新打开问题'
              %li
                = link_to '关闭问题', issue_path(@issue, issue: { state_event: :close }, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn-close #{issue_button_visibility(@issue, true)}", title: '关闭问题'
              %li
                = link_to '编辑', edit_namespace_project_issue_path(@project.namespace, @project, @issue)
        - if can?(current_user, :create_issue, @project)
          = link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'hidden-xs hidden-sm btn btn-nr btn-grouped new-issue-link btn-success', title: '新问题', id: 'new_issue_link' do
            = icon('plus')
            新问题
        - if can?(current_user, :update_issue, @issue)
          = link_to '重新打开问题', issue_path(@issue, issue: { state_event: :reopen }, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "hidden-xs hidden-sm btn btn-nr btn-grouped btn-reopen #{issue_button_visibility(@issue, false)}", title: '重新打开问题'
          = link_to '关闭问题', issue_path(@issue, issue: { state_event: :close }, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "hidden-xs hidden-sm btn btn-nr btn-grouped btn-close #{issue_button_visibility(@issue, true)}", title: '关闭问题'
          = link_to edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: 'hidden-xs hidden-sm btn btn-nr btn-grouped issuable-edit' do
            = icon('pencil-square-o')
            编辑


.issue-details.issuable-details
  .detail-page-description.content-block
    %h2.title
      = markdown escape_once(@issue.title), pipeline: :single_line
    - if @issue.description.present?
      .description{ class: can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '' }
        .wiki
          = preserve do
            = markdown(@issue.description, cache_key: [@issue, "description"])
        %textarea.hidden.js-task-list-field
          = @issue.description
    = edited_time_ago_with_tooltip(@issue, placement: 'bottom', html_class: 'issue_edited_ago')

    #merge-requests{ data: { url: referenced_merge_requests_namespace_project_issue_url(@project.namespace, @project, @issue) } }
      // This element is filled in using JavaScript.

    #related-branches{ data: { url: related_branches_namespace_project_issue_url(@project.namespace, @project, @issue) } }
      // This element is filled in using JavaScript.

  .content-block.content-block-small
    = render 'new_branch'
    = render 'votes/votes_block', votable: @issue

  %section.issuable-discussion
    = render 'projects/issues/discussion'

= render 'shared/issuable/sidebar', issuable: @issue
